﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EZCRS.HCMS.Entity;
using EZCRS.HCMS.Data;

namespace EZCRS.HCMS.SqlClient
{
    public class sql_hcrs_country
    {
        /// <summary>
        /// 获得所有国家信息
        /// </summary>
        /// <param name="languagetype">语言选择</param>
        /// <returns></returns>
        public List<HCRS_Country> getcountry(int languagetype)
        {
            return ExecSql.GetTableList<HCRS_Country>("select * from HCRS_Country");
        }
        public bool deletecountry(int id)
        {
            return (ExecSql.SqlExecNoquery("delete from HCRS_Country where countryid=" + id.ToString()) > 0) ? true : false;
        }

        public HCRS_Country getitem(int id)
        {
            return new HCRS_Country(ExecSql.GetDataSet("select * from HCRS_Country where countryid=" + id.ToString()).Tables[0].Rows[0]);
        }

        public bool insertorupdate(HCRS_Country _country)
        {
            return ExecSql.InsertOrUpdateData<HCRS_Country>(_country);
        }
    }
}
